// Properties.java - Simple extension of java.util.Properties.
//
// Copyright (C) 1999-2002  Smart Software Consulting
// 
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
// 
// Smart Software Consulting
// 1688 Silverwood Court
// Danville, CA  94526-3079
// USA
// 
// http://www.smartsc.com
//

package com.smartsc.util;

public class
Properties
extends java.util.Properties
{
	public Properties()
	{
	}
		
	public Properties( java.util.Properties defaultProps)
	{
		super( defaultProps);
	}
		
	public int getIntProperty( String name)
	{
		return getIntProperty( name, -1);
	}
		
	public int getIntProperty( String name, int defaultValue)
	{
		String value = getProperty( name, String.valueOf( defaultValue));
		try { return Integer.parseInt( value); }
		catch( NumberFormatException nfe) { return defaultValue; }
	}
		
	public void setIntProperty( String name, int value)
	{
		put( name, String.valueOf( value));
	}
		
	public boolean getBooleanProperty( String name)
	{
		return getBooleanProperty( name, false);
	}
		
	public boolean getBooleanProperty( String name, boolean defaultValue)
	{
		String value = getProperty( name, String.valueOf( defaultValue));
		return Boolean.valueOf( value).booleanValue();
	}
		
	public void setBooleanProperty( String name, boolean value)
	{
		put( name, String.valueOf( value));
	}
}
	
